<?php
declare (strict_types = 1);
namespace app\common\model\payment;

use app\common\model\BaseModel;

/**
 * 交易记录模型
 */
class Transaction extends BaseModel
{
    /**
     * 表名
     * @var string
     */
    protected $name = 'payment_transaction';

    /**
     * 设置自动写入时间
     * @var boolean
     */
    protected $autoWriteTimestamp = true;
    protected $hidden             = ['delete_time'];

    /**
     * 定义字段类型
     * @var array
     */
    protected $type = [
        'id'          => 'integer',
        'create_time' => 'integer',
        'update_time' => 'integer',
    ];

    public function scopeOrderNo($query, $order_no)
    {
        $query->where('order_no', $order_no);
    }

}
